import random
import json

# 加载预定义的中文姓氏和名字库
with open("chinese_names.json", "r", encoding="utf-8") as file:
    names_data = json.load(file)
    surnames = names_data["surnames"]
    given_names_male = names_data["given_names_male"]
    given_names_female = names_data["given_names_female"]

def generate_random_name():
    return f"{random.choice(surnames)}{random.choice(given_names_male if random.random() < 0.5 else given_names_female)}"

name = generate_random_name()
print(name)